import { Inject, Injectable } from '@nestjs/common';
import { Prisma } from '@prisma/client';
import { PrismaService } from 'src/prisma.service';

@Injectable()
export class UserService {
  @Inject(PrismaService)
  private prisma: PrismaService;

  async create(data: Prisma.auth_userCreateInput) {
    const user = await this.prisma.auth_user.findUnique({
      where: { username: data.username },
    });
   
    if (user) {
      throw
    }
   
    return await this.prisma.auth_user.create({
      data,
      select: {
        id: true,
        username: true,
        name: true,
      },
    });
  }
}
